#include <cstdio>
#include <algorithm>
using namespace std;
struct tag
{
    double inventory;
    double price;
    double unit_price;
} moon[1001];
bool cmp(tag l, tag r)
{ //按照单价非递增排序
    return l.unit_price > r.unit_price;
}
int main()
{
    int N;
    double D;
    scanf("%d%lf", &N, &D);
    int i;
    for (i = 0; i < N; ++i)
    {
        scanf("%lf", &moon[i].inventory);
    }
    for (i = 0; i < N; ++i)
    { //读取的同时计算单价
        scanf("%lf", &moon[i].price);
        moon[i].unit_price = moon[i].price / moon[i].inventory;
    }
    sort(moon, moon + N, cmp);
    double total = 0;
    for (i = 0; i < N; ++i)
    {
        if (D > moon[i].inventory)
        {
            total += moon[i].price;
            D -= moon[i].inventory;
        }
        else
        {
            total += moon[i].unit_price * D;
            break;
        }
    }
    printf("%.2f\n", total);
    return 0;
}